From 07ee1ae116f227e7d7f404fa39937052b0af6431 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 16 Dec 2025 11:45:36 +0100 Subject: [PATCH] Enable file locking support for Hurd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit like Illumos in #148322, Hurd was missed when originally introducing locking gates per target OS in #132977. building rustc on Hurd was broken as a result since 1.91. Signed-off-by: Fabian Grünbichler Gbp-Pq: Topic upstream Gbp-Pq: Name Enable-file-locking-support-for-Hurd.patch --- library/std/src/fs/tests.rs | 4 ++++ library/std/src/sys/fs/unix.rs | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 0517760c35..6e89728196 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -226,6 +226,7 @@ fn file_test_io_seek_and_write() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -251,6 +252,7 @@ fn file_lock_multiple_shared() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -277,6 +279,7 @@ fn file_lock_blocking() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -300,6 +303,7 @@ fn file_lock_drop() { #[cfg(any( windows, target_os = "freebsd", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs index 3efe67390d..df03fb5604 100644 --- a/library/std/src/sys/fs/unix.rs +++ b/library/std/src/sys/fs/unix.rs @@ -1288,6 +1288,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1312,6 +1313,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1327,6 +1329,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1351,6 +1354,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1366,6 +1370,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1406,6 +1411,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1424,6 +1430,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1464,6 +1471,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1482,6 +1490,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1506,6 +1515,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", -- 2.30.2